package com.js.common.core;

import com.js.domian.entity.bot.WebsocketEntity;
import com.js.service.bot.basics.WebsocketService;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;

@Component
public class BotCommandLineRunner implements CommandLineRunner {

    @Resource
    protected WebsocketService websocketService;

    @Override
    public void run(String... args) {
        List<WebsocketEntity> list = websocketService.getAllWebsocketList();
        for (WebsocketEntity entity : list) {
            websocketService.generateWebSocketClient(entity);
        }
    }
}
